#ifndef QOBJECTLISTVIEW_H
#define QOBJECTLISTVIEW_H

#include <QTreeWidget>


class QObjectListView : public QTreeWidget
{
    Q_OBJECT
public:
    explicit QObjectListView(QWidget *parent = 0);

protected slots:
    void    clickedItem(QTreeWidgetItem* item,int);

    void    formDestroyed();
protected:
    void    drawRow(QPainter *painter, const QStyleOptionViewItem &options, const QModelIndex &index) const;
public slots:
    void    formAdd(QWidget* wid);
    void    addWidget(QWidget* wid,int);
    void    widgetRemove(QWidget* wid);
    void    selectWidget(QWidget* wid);
    void    nameChanged();
    void    currentObjectChanged(QTreeWidgetItem * current, QTreeWidgetItem * previous );
    void    clear_list();
signals:
    void    selectSignal(QWidget* wid);
protected:
    QMap<QWidget*,QTreeWidgetItem*>     m_formItems;
    QMap<QWidget*,QTreeWidgetItem*>     m_widgetItems;
    QMap<QWidget*,QTreeWidgetItem*>     m_allItems;
    QMap<QTreeWidgetItem*,QWidget*>     m_itemToWidget;
};

#endif // QOBJECTLISTVIEW_H
